﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bluyel.Core
{
    /// <summary>
    /// Represents a data named string.
    /// Can be a var or a const.
    /// </summary>
    public class DString : DBasicBase
    {
        //---------------------------------------------------------------------
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="name"></param>
        public DString(string name, IType type)
            : base(name, type)
        {
        }

        //---------------------------------------------------------------------
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="name"></param>
        public DString(string name, IType type, VarOrConst varOrConst)
            : base(name, type, varOrConst)
        {
        }

        //---------------------------------------------------------------------
        /// <summary>
        /// The string value
        /// </summary>
        public new ValueString DVal
        {
            get { return base.DVal as ValueString; }
        }

        //---------------------------------------------------------------------
        /// <summary>
        /// The string value
        /// </summary>
        public string Val
        {
            get { return DVal.GetValue(); }
        }

        //---------------------------------------------------------------------
        public bool SetDVal(ValueString dv)
        {
            if (dv == null)
                return false;

            return base.SetDVal(dv);
        }

    }
}
